﻿using Model.Manager.DataBase;

namespace Model.Manager
{
    /// <summary>
    ///     数据源工厂用于可获得数据源的容器
    /// </summary>
    public static class ContextFactory
    {
        /// <summary>
        ///     如需更换数据库且非得做额外的处理，实现IConfiger接口即可
        /// </summary>
        private static readonly IConfiger Configer = new DbConfiger();

        /// <summary>
        ///     业务逻辑（业务）的数据库连接,SQLSERVER
        /// </summary>
        public static IDbContext GetBlConn()
        {
            return Configer.CreateConext(DbConnections.BusinessLogic);
        }

        /// <summary>
        ///     系统功能（日志）的数据库连接,SQLSERVER
        /// </summary>
        /// <returns></returns>
        public static IDbContext GetPlatformConnect()
        {
            return Configer.CreateConext(DbConnections.SystemicFunction);
        }

    }

    /// <summary>
    ///     数据库连接
    /// </summary>
    public enum DbConnections
    {
        /// <summary>
        ///     业务逻辑(BL) 数据库
        /// </summary>
        BusinessLogic = 1,

        /// <summary>
        ///     系统功能(SF)数据库
        /// </summary>
        SystemicFunction = 2
    }



    
}